home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / MacHaskell 2.2 / com / mcl / savesys.lisp < prev    next >
Encoding:
Text File  |  1994-09-27  |  2.2 KB  |  59 lines  |  [TEXT/CCL2]

  1. ;;; savesys.lisp -- make a Yale Haskell executable 
  2.  
  3. (load "Macintosh HD:haskell:com:mcl:mcl-setup.lisp")
  4. (setf *load-verbose* t)
  5. (setf *compile-verbose* t)
  6. (setf ccl:*record-source-file* nil)
  7. (proclaim '(optimize (speed 3) (safety 0) (debug 1) (compilation-speed 0)))
  8. ;(proclaim '(optimize (speed 1) (safety 3) (debug 3) (compilation-speed 0)))
  9. (load "Macintosh HD:haskell:cl-support:cl-init.lisp")
  10. (setf *load-verbose* nil)
  11. (setf *compile-verbose* nil)
  12. (in-package :mumble-user)
  13. (setf *printers* '(compiling loading prompt))
  14. (setf *code-chunk-size* 300)
  15. (setf *compile-interface* '#f)
  16. (compile/load *prelude-unit-filename*)
  17. ;;; Doing this now will pre-initialize menus instead of having this
  18. ;;; done at system startup time.
  19. (setf *modules-loaded* '())
  20. (use-mac-interface)
  21. (define (haskell-toplevel)
  22.   (setf cl:*package* (cl:find-package :mumble-user))
  23.   (mac-load-init-files)
  24.   (use-mac-interface)
  25.   ;; Open buffers to any files that were selected.
  26.   (let ((files  (ccl::finder-parameters)))
  27.     (when (eq? (car files) :open)
  28.       (dolist (f (cdr files))
  29.         (when (eq? (ccl::mac-file-type f) :text)
  30.           (cl:ed f)))))
  31.   (do () ('#f)
  32.     (cl:with-simple-restart (restart-haskell "Restart Haskell.")
  33.       (heval))))
  34. (define (restart-haskell)
  35.   (cl:invoke-restart 'restart-haskell))
  36. (define (haskell-debugger-hook c f)
  37.   (declare (ignore f))
  38.   (if *haskell-debug-in-lisp*
  39.       (begin
  40.         (when *haskell-enter-debugger-hook*
  41.           (funcall *haskell-enter-debugger-hook*))
  42.         (cl:unwind-protect (cl:invoke-debugger c)
  43.           (when *haskell-exit-debugger-hook*
  44.             (funcall *haskell-exit-debugger-hook*))))
  45.       (begin
  46.         (format '#t "Lisp error:~%~a~%" c)
  47.         (haskell-backtrace)
  48.         (when *haskell-compilation-error-hook*
  49.           (funcall *haskell-compilation-error-hook*))
  50.         (format '#t "Restarting Haskell...~%")
  51.         (restart-haskell))))
  52. (setf cl:*debugger-hook* (function haskell-debugger-hook))
  53. (setf mumble-implementation::*mac-file-creator* :yhs2)
  54. (ccl:save-application "Macintosh HD:haskell:bin:new-mac-haskell"
  55.   ;; Comment out the next line if not making a standalone delivery binary
  56.   :excise-compiler '#t
  57.   :toplevel-function #'haskell-toplevel
  58.   :creator :yhs2)
  59.